<template>
  <a-layout-header class="header">
      <div class="title">
        VUE3+VITE 系统
      </div>
      <div class="login-btn">
        <a-dropdown >
          <a class="ant-dropdown-link" @click.prevent>
            我已经登录
            <DownOutlined />
          </a>
          <template #overlay>
            <a-menu @click="clickBtn">
              <a-menu-item key="logout">
                <a href="javascript:;">退出</a>
              </a-menu-item>
              <a-menu-item key="goto">
                <a href="javascript:;">跳转</a>
              </a-menu-item>
            </a-menu>
          </template>
        </a-dropdown>
      </div>
  </a-layout-header>
</template>

<script setup lang="ts">
  import { useRouter } from 'vue-router';


  const router = useRouter()

  const clickBtn =(e:any) => {
    if(e.key === 'logout') {
      router.push('/login')
    }
  }
</script>

<style lang="scss" scoped>
.header{
  display: flex;
  justify-content: space-between;
  color: #fff;
  .title{
    font-size: 24px;
    font-weight: bold;
  }
}
</style>